<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>堆栈内存</title>
</head>
<body>
<script>
    //真正的编程应该从堆栈(内存)分析开始
    // 堆(内存) Heap 存储计算所用的数据 仓库
    // 栈(内存) Stack 存贮计算过程空间 先进先出 先进后出
    //cpu <=pci总线=> 内存 <==> 硬盘
    // 量子计算机
    // 生物




/*
    let a = 12;
    var a = 12; //预解释
    var b = a;
    b = 13;
    console.log(a);//12

*/


    var a = {n:12};
    var b = a;
    b.n = 13;
    //成员访问
    // b["n"] = 13;
/*    let x = "n";
    b[x] = 13;*/
    console.log(a.n);//13

    //b.n ==>成员访问 优先级最高
    //正常代码 从右到左执行
    //var a = b = 12;
    //b = 12;
    //a = 12;

    //成员访问 优先级最高
    // let a = {};
    // a.x = a = 12;
    // // a.x = 12;
    // // a = 12;
    // console.log(a)

    //练习题 思考题
    var a = {
        n : 10
    }
    var b = a;
    a.x = a = {
        n : 20
    }
    console.log(a.x);
    console.log(b);






/*
    let a = b = c = 13;
    b = 12;
    console.log(a,c);*/

</script>
</body>
</html>